class TUICallDefine {
  static const String version = "0.0.0.0";
}

/// Indicates the error code during the calls.
///
class TUICallError {
  /// You have not purchased the calls capability package, please go to the IM console to activate the free experience or purchase the official version.
  static const int errorPackageNotPurchased = -1001;

  /// The calls capability package you currently purchased does not support this function. It is recommended that you upgrade the package type.
  static const int errorPackageNotSupported = -1002;
}

/// Indicates the media room id of the calls.
///
class TUIRoomId {
  int intRoomId;

  TUIRoomId({required this.intRoomId});

  Map<String, dynamic> toJson() {
    final Map<String, dynamic> data = <String, dynamic>{};
    data['intRoomId'] = intRoomId;
    return data;
  }
}

/// Indicates the media type of the calls.
///
enum TUICallMediaType {
  /// 0: Default value, unknown media type,
  none,

  /// 1: Audio calls
  audio,

  /// 2: Video calls
  video
}

/// Indicates the role in the calls.
///
enum TUICallRole {
  /// 0: Default value, no role.
  none,

  /// 1: Caller, the member who initiated the calls.
  caller,

  /// 2: Called, the member invited to the calls.
  called
}

/// Indicates the calls status
///
enum TUICallStatus {
  /// 0: Default value, Idle state.
  none,

  /// 1: Waiting accept/reject state.
  waiting,

  /// 2: In calling state.
  accept
}

/// Indicates the call scene, including 1v1 calls, group calls etc.
enum TUICallScene {
  /// 0: Group call.
  /// notes: you need to create an IM group in advance
  groupCall,

  /// 1: Todo Non-group multi calls.
  /// notes: No need to create an IM group in advance.
  multiCall,

  /// 2: 1v1 calls.
  singleCall
}

/// network quality
enum TUINetworkQuality {
  /// 0: unknow
  unknown,

  /// 1: excellent
  excellent,

  /// 2: good
  good,

  /// 3: poor
  poor,

  /// 4: bad
  bad,

  /// 5: vBad
  vBad,

  /// 6: down
  down,
}

/// network quality info
class TUINetworkQualityInfo {
  /// user id
  String userId;

  /// network quality
  TUINetworkQuality quality;

  TUINetworkQualityInfo({required this.userId, required this.quality});
}

/// Generic function return type
class TUIResult {
  String code;
  String? message;

  TUIResult({
    required this.code,
    required this.message,
  });
}

class TUICallParams {
  TUIOfflinePushInfo offlinePushInfo;
  TUICallParams({required this.offlinePushInfo});

  Map<String, dynamic> toJson() {
    final Map<String, dynamic> data = <String, dynamic>{};
    data['offlinePushInfo'] = offlinePushInfo.toJson();
    return data;
  }

}

class TUIOfflinePushInfo {
  String? title;
  String? desc;
  bool? ignoreIOSBadge;
  String? iOSSound;
  String? AndroidSound;
  String? AndroidOPPOChannelID;
  int? AndroidVIVOClassification;

  Map<String, dynamic> toJson() {
    final Map<String, dynamic> data = <String, dynamic>{};
    data['title'] = title;
    data['desc'] = desc;
    data['ignoreIOSBadge'] = ignoreIOSBadge;
    data['iOSSound'] = iOSSound;
    data['AndroidSound'] = AndroidSound;
    data['AndroidOPPOChannelID'] = AndroidOPPOChannelID;
    data['AndroidVIVOClassification'] = AndroidVIVOClassification;
    return data;
  }
}



